<?php
//构造方法 在实例化对象的时候自动调用
class Student{
    private $name;
    private $age;
    function __construct($name,$age)
        {
            echo "我是构造函数";
            $this->name=$name;
            $this->age=$age;
        }
    public function show()
    {
        echo $this->name;
        echo $this->age;
    }
}
//练习：js里构造函数怎么写
$stu1=new Student('zhangjie','10');
$stu1->show();
?>